package com.mtsmda.jersey.mkyong;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Response;

@Path("/hello")
public class GreetingWS {

	public static final Integer STATUS_200 = 200;

	@GET
	@Path("/{hi}")
	public Response greeting(@PathParam("hi") String name) {
		if (name != null && !name.isEmpty()) {
			return Response.status(STATUS_200).entity("Hello, " + name + "!")
					.build();
		}
		return Response.status(STATUS_200).entity("Hello!").build();
	}

}